package guestbook

import (
	"github.com/labstack/echo"
	auth "tacitus/library/authorized"
)

func RouteApi(g *echo.Group)  {
	g.POST("/public", ShowPublicityCommentListHandler)
	g.POST("/mine", ShowMyCommentListHandler, auth.CheckLogin)
	g.POST("/add", AddCommentInUnLoggedHandler)
	g.POST("/add/logged", AddCommentInLoggedHandler, auth.CheckLogin)
}

func RouteAdminApi(g *echo.Group)  {
	g.POST("/list", ShowCommentListHandler, auth.CheckAuth("guestbook"))
	g.POST("/reply", ReplyCommentHandler, auth.CheckAuth("guestbook.reply"))
}